A room is a sized, tiled space with the instances, paths and camera settings you placed in it.
A room is everything the editor's Room Editor tab lets you place and set for one space: its size, its background color, its tile layers and which tileset each one uses, the instances placed in it (each with its own creation code), the paths placed in it, the camera's settings for it, the room's own creation code, and which transition plays when the player leaves it toward each exit. All of that is generated data the compiler turns into one entry in the room table - nothing about a room is hand-written GBML.
room_change(room_boss_arena);In the Room Editor, Room Properties shows the room's size and a Resize... button. The button opens a window with a picture of the room on the left and two boxes on the right, Width and Height, each with a - and a + (a step is 8 pixels).
The glowing rectangle is the new size. Type a number or press the buttons and it grows or shrinks from its middle. You cannot drag it; you drag the room instead. Hold the left mouse button on the picture and move it, and the room slides inside the rectangle, a whole tile at a time. The middle wheel zooms where the pointer is, and dragging with the middle button moves the whole view.
Anything that ends up outside the rectangle is removed when you press Accept. The window shows it dimmed with a red tint, and a line counts it for you: "This resize will remove 12 tiles and 3 objects." If nothing is cut it says so. Cancel changes nothing, and one Undo takes a whole resize back.
When you slide the room, everything in it slides with it: tiles, collision, objects, doors and regions. The numbers you typed in your own code do not change, so the window lists every place in your code that names a position in that room. Look at each one and fix it if it should have moved too.
A world has the same window, with its size in screens. It steps 2 screens at a time, the size of one piece, and the picture slides one piece at a time.
room_change, room_change_ext, room_next, room_restart, room_current, room_width, room_height are the functions that read and move between rooms from code. room_change_ext additionally carries one instance into the destination room and picks the transition itself, the same way teleporters do. room_change_seamless changes room with no transition at all, carrying the instance that calls it (and, with its optional fourth value, the instances near it) and the camera so the picture does not change.
A room does not remember itself, unless you ask it to. Every time you enter an ordinary room, the engine builds it again from the data you authored in the editor: the instances you placed are created fresh, at the places and with the values you gave them. Leave a room and come back, and anything you destroyed, moved or changed in it is back the way you placed it. (persistent on one instance is a different thing: a persistent instance is carried along into the next room instead of being cleared.) To remember something across a visit - a chest that was already opened, a door that was unlocked - keep it in a global variable while the game runs, or write it with save_set if it should survive turning the console off. Then have the room's own creation code, or an object's Room Start event, read it back and tidy things up (for instance, destroy the chest that was already opened).
To keep a whole room as the player left it, mark it Persistent in Room Properties (under Transitions and Values). A persistent room is kept when the player leaves it: every object in it stays exactly as it was, and is there again on the way back. The game keeps up to four such rooms at once (Project Settings, Engine limits). Persistent rooms says what comes back, what does not, which events run on the way back, and what it costs.
A room's tiles can fade or turn blocky. In the Room Editor, Tile Palette, Tile layers, each layer has an Effect: Fade, Blocks or a wobble. It does what background_see_through and background_blocky do for a background, but for that one layer, and the room starts it itself the moment it loads, before any Create code runs, so your code can still change it or switch it off. screen_blend and screen_mosaic can also start a look from code. The console has just one fade and one block size for the whole screen, so every layer that wears one shows the same look. The effect belongs to the room, so it is there every time the room loads - on a return visit and after a restart too - with nothing to call.
A room's picture can move slower than the camera. The Scroll speed of the Main layer (Room Editor, Tile Palette, Tile layers), or of the room's picture (Tile Palette, Backgrounds), says how far it moves compared with the view, in percent, across and down: 100 moves with the room, 50 half as far (it looks far away), 0 stays fixed on the screen. It moves the layers the room already has, so it never uses another background layer. A picture you make in code has background_scroll_speed.
Every position in a room is counted from the room's top-left corner: (0, 0) is that corner, x counts pixels to the right and y counts pixels down. A room 320 pixels wide and 320 tall spans 0 to 320 on both sides, so its middle is (160, 160). Where (0, 0) is has the whole rule.
A room's tile layers are ordinary backgrounds with one extra thing attached: an 8×8-pixel attribute grid alongside the tile data. Each cell's attribute byte carries a mutually-exclusive tile class - TILE_PASS/TILE_SOLID/TILE_LOW_COVER, see tile_class for what each one actually blocks - plus up to six more bits a project names itself, commonly something like hurt or water. The grid starts at the room's top-left corner too. This is the same grid the engine's collision functions read, so a wall painted into the tilemap blocks movement without a single placed collision instance anywhere near it.
There is no special-cased "empty project" mode - a project with zero rooms compiles and boots exactly like any other, straight to a black screen with the debug overlay confirming there is nothing to show yet. That is deliberately just what an empty room list produces, not a fallback path the tools carve out separately.
A room painted with tiles can have at most 65,536 tiles in all, and no side over 8,192 pixels (1,024 tiles): 2,048 by 2,048 pixels (256 by 256 tiles) is the biggest square, and 8,192 by 512 pixels is a long corridor. A bigger one would draw nothing but black, so Room Properties keeps the size inside that and says so (the side you did not just type stays, the one you typed gives way), and the Problems list and the build refuse a room that is bigger: make it smaller, split it into two rooms joined by a door, or give it a background picture instead of painted tiles.
A room painted with the tiles of several tile sets can use more tiles than the console shows at once (a layer names at most 1,024). Cut it into tile areas in Room Properties (the Split for me button does it for you): each area has tiles of its own, loaded when the camera comes within half a screen of it, and tiles many areas share stay loaded. A room that cannot be cut so that its tiles fit is refused in words, naming the room and the area. A room with areas plays animated tiles, shows the autotiles of other tile sets and lays autotiles from code like any other room; the animated tiles, and the tiles of the autotiles your code can lay, stay loaded in every area, so they count against the tiles the console holds at once.
A painted room over 512 pixels wide or tall is a big room: the console keeps all of its picture on the cartridge and shows part of it at a time, so it costs no working memory (the Budgets panel shows its cartridge space in a row of its own). Scrolling it costs about a percent of a frame. A big room works like any other room, with one thing that is not there yet: it cannot have collision layers. Its tiles can change while the game runs (tile_set_class, tile_set_index and the rest): the big room has no copy of its tiles in memory, so what your game changes is kept in a table of up to 1,024 changed tiles by default, which takes 12 KB of working memory (a game that never changes a big room's tiles keeps none; the Budgets panel shows it in a row of its own, and Tiles a big room can change at once in Project Settings makes the table bigger or smaller, from 256 to 4,096). A change past that number is ignored, and the debug view counts how many were (its CHANGED and DROPPED rows). A tile you changed stays changed when it scrolls off the screen and comes back, and when the room loads again every tile is the picture's own again. tile_set_auto and tile_clear_auto do nothing in a big room yet, and a game that calls them while it has a big room gets a warning that names the room (use tile_set_index there).
A room can also place no more copies of an object than that object's Max instances. Place five doors of an object whose Max instances is 4 and the build stops, naming the room and the object; raise Max instances to at least the number placed, or place fewer.
A path is its own kind of project asset, separate from a room but usually placed inside one: an ordered list of points an instance can be told to follow with path_start(p, speed, end_action, relative), reading its progress back from the instance's own path/path_pos/ path_speed/path_end_do variables (Objects and instances). Reaching the end of a path fires that instance's Path End event (Events), and what "the end" actually does depends on which of four end actions the path was started with (the picture shows an open path):


PATH_STOP - the instance simply stops there.PATH_LOOP - on an open path it jumps straight back to the start (a snap, it does not travel back) and keeps going. On a closed path the last point is the first point, so it carries on smoothly with no jump.PATH_PING_PONG - it reverses and follows the same path backward.PATH_CONTINUE - it keeps moving in whatever direction it was last heading, past the path's own end.A path can be followed relative to wherever the instance started, rather than at its absolute drawn position - which is what makes one patrol path reusable by placing several instances at different starting points, each patrolling the same shape around themselves rather than all converging on the path's literal drawn coordinates. A full reference for paths - authoring them in the editor's own Paths tab, and the rest of the path-reading functions - is its own manual page in a later phase; this page only covers what a room needs to know about them.
A door is not a room field or a separate engine concept at all - it is an ordinary placed instance the editor's own Room Editor generates ("+ Add Door" in the Doors list), carrying its own door_id, locked and door_mode as plain instance variables. door_lock, door_unlock, door_is_locked, door_set_mode and door_mode read and write those by door_id - a project-wide-unique number shown in the Doors list - without needing a reference to the door instance itself, which is what lets a distant switch lock or unlock a gate it holds no other connection to.
A door may also be given its own project-wide-unique NAME in that same Configure dialog. Every one of the five functions above accepts a door's name in place of its door_id - door_lock(front_gate) reads exactly as it looks, and resolves to the door's own door_id at compile time, for zero ROM cost. An unknown or deleted door name is a build error naming it, not a call that compiles and does nothing - the one real advantage a name has over a hardcoded door_id, which can go stale if that door is ever deleted and re-added (its door_id is not guaranteed to come back the same).
Every door names the direction it plays in a passage from the player's own journey through it, never the room's: an Enter door is the one walked INTO (it sends); an Exit door is the one come OUT of (it receives). A one-way passage links an Enter door to an Exit door; door_set_mode's own three modes - DOOR_TWO_WAY/DOOR_ENTER_ONLY/DOOR_EXIT_ONLY - are what choose that from code. Locking a door (door_lock) blocks it from sending only - a locked door still works as an Exit, still a valid arrival target - see door_is_locked for the full reasoning.
Like a door instance's own default locked/door_mode values, a door's own state is never persistent - it is cleared with the rest of its room the moment that room is no longer current, so all five of these functions only ever find a door that is a live instance in the room loaded right now; a door_id from elsewhere is a harmless no-op or a documented "not found" default, never a crash and never a write to the wrong door - see each function's own page for exactly what it reads back in that case.
Entering and leaving a room are their own boundary in the frame order, not an ordinary frame - the "Entering a room" section of The order of a frame covers exactly what runs, and in what order, the instant a room starts.